home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / sisparam.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.8 KB  |  76 lines

  1. /* Copyright (C) 1995, 1996, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: sisparam.h,v 1.2 2000/09/19 19:00:50 lpd Exp $ */
  20. /* Generic image scaling stream definitions */
  21. /* Requires strimpl.h */
  22.  
  23. #ifndef sisparam_INCLUDED
  24. #  define sisparam_INCLUDED
  25.  
  26. /*
  27.  * Image scaling streams all use a common set of parameters to define the
  28.  * input and output data.  That is what we define here.
  29.  */
  30.  
  31. /* Input values */
  32. /*typedef byte PixelIn; */  /* per BitsPerComponentIn */
  33. /*#define MaxValueIn 255 */  /* per MaxValueIn */
  34.  
  35. /* Output values */
  36. /*typedef byte PixelOut; */  /* per BitsPerComponentOut */
  37. /*#define MaxValueOut 255 */  /* per MaxValueOut */
  38.  
  39. /*
  40.  * The 'support' S of a digital filter is the value such that the filter is
  41.  * guaranteed to be zero for all arguments outside the range [-S..S].  We
  42.  * limit the support so that we can put an upper bound on the time required
  43.  * to compute an output value and on the amount of storage required for
  44.  * X-filtered input data; this also allows us to use pre-scaled fixed-point
  45.  * values for the weights if we wish.
  46.  *
  47.  * 8x8 pixels should be enough for any reasonable application....
  48.  */
  49. #define LOG2_MAX_ISCALE_SUPPORT 3
  50. #define MAX_ISCALE_SUPPORT (1 << LOG2_MAX_ISCALE_SUPPORT)
  51.  
  52. /* Define image scaling stream parameters. */
  53. typedef struct stream_image_scale_params_s {
  54.     int Colors;            /* >= 1 */
  55.     int BitsPerComponentIn;    /* bits per input value, 8 or 16 */
  56.     uint MaxValueIn;        /* max value of input component, */
  57.                 /* 0 < MaxValueIn < 1 << BitsPerComponentIn */
  58.     int WidthIn, HeightIn;    /* > 0 */
  59.     int BitsPerComponentOut;    /* bits per output value, 8 or 16 */
  60.     uint MaxValueOut;        /* max value of output component, */
  61.                 /* 0 < MaxValueOut < 1 << BitsPerComponentOut*/
  62.     int WidthOut, HeightOut;    /* > 0 */
  63. } stream_image_scale_params_t;
  64.  
  65. /* Define a generic image scaling stream state. */
  66.  
  67. #define stream_image_scale_state_common\
  68.     stream_state_common;\
  69.     stream_image_scale_params_t params
  70.  
  71. typedef struct stream_image_scale_state_s {
  72.     stream_image_scale_state_common;
  73. } stream_image_scale_state;
  74.  
  75. #endif /* sisparam_INCLUDED */
  76.